import pickle
import numpy as np
from sklearn import svm
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split


X = np.loadtxt("data/X.csv", delimiter=",")
y = np.loadtxt("data/y.csv", delimiter=",")


X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)


# linreg = LinearRegression()
# linreg.fit(X, y)
clf = svm.SVC(kernel="linear")
clf.fit(X_train, y_train)
# with open('data/Bumblebee.model', 'rb') as fr:
#     BumblebeeModel = pickle.load(fr)
# score = linreg.score(X, y)
score = clf.score(X_test, y_test)
print(score)
# result_list = clf.predict(X)
# for r in result_list:
#     print(r)
